package flirtme.server;

import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;

import com.loopj.android.http.JsonHttpResponseHandler;

import flirtme.constants.Constants;

public class FlirtMeAsyncHttpResponseHandler extends JsonHttpResponseHandler {
	Context context;

	public FlirtMeAsyncHttpResponseHandler(Context context) {
		super();
		this.context = context;
	}
	
	public Context getContext() {
		return context;
	}
	
	static public Boolean  isValid (JSONObject response)  {
		String error = null;
		try {
			error = response	.getString(Constants.ERROR_NUMBER);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return  error.equalsIgnoreCase(Constants.NO_ERROR);
		
	}

}
